<template>
  <div class="">
    <el-card>
      <el-table :data="allRoles" border style="width: 100%">
        <el-table-column label="序号" type="index" width="120" />
        <el-table-column label="名称" prop="title" />
        <el-table-column label="描述" prop="describe" />
        <el-table-column
          label="操作"
          prop="action"
          width="260"
          #default="{ row }"
        >
          <el-button
            type="primary"
            size="mini"
            @click="onDistributePermissionClick(row)"
          >
            分配权限
          </el-button>
        </el-table-column>
      </el-table>
    </el-card>

    <!-- <distribute-permission
      v-model="distributePermissionVisible"
      :roleId="selectRoleId"
    ></distribute-permission> -->
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { roleList } from '@/api/user'

// 获取角色数据
const allRoles = ref([])
const getRoleList = async () => (allRoles.value = await roleList())
getRoleList()

const onDistributePermissionClick = (row) => {
  console.log('onDistributePermissionClick', row)
}
</script>

<style scoped></style>
